//
// Created by tanji on 2025/3/23.
//

#ifndef ESP01S_MQTT_WEB_WIFICONFIG_H
#define ESP01S_MQTT_WEB_WIFICONFIG_H
#include "config/GlobalConfig.h"

class WifiConfig {
public:
    explicit WifiConfig(GlobalConfig& config);
    static void init();
    void loop();
    // 切换成联网模式
    void setWIFI_STA();
    // 尝试连接 WiFi
    void tryConnectWiFi();

private:
   void connectWiFi();
    GlobalConfig& config;
    unsigned long lastLoopTime;
    const unsigned long loopInterval = 10000; // 每 10000 毫秒调用一次
};


#endif //ESP01S_MQTT_WEB_WIFICONFIG_H
